package gameAdvance;

public class GameTest {
    public static void main(String[] args) {
        //创建第一个角色
        Role r1 = new Role("YUsc",100,'男');
        //创建第二个角色
        Role r2 = new Role("恐龙",100,'男');

        r1.showRoleInfo();
        r2.showRoleInfo();
        //用于记录回合制
        int count = 1;
        //攻击模式采用回合制
        while (true){
            System.out.println("第 "+count+" 回合");
            //r1攻击r2
            r1.attack(r2);
            if(r2.getBlood() == 0){
                System.out.println(r1.getName()+"K.O了"+ r2.getName());
                break;
            }

            //r2攻击r1
            r2.attack(r1);
            if(r1.getBlood() == 0){
                System.out.println(r2.getName()+" K.O了 "+ r1.getName());
                break;
            }

            count+=1;
            System.out.println("------------------");
        }
    }

}
